<template>
    <div v-if="msg" class="note">
        {{ msg }}
    </div>
</template>
<script>
export default {
    data(){
        return {
            msg:"",
            ind:null,
        }
    },
    methods:{
        show(msg){
            clearTimeout(this.ind);
            this.msg = msg;
            this.ind = setTimeout(()=>{
                this.hide();
            },2000)
        },
        hide(){
            this.msg = "";
        }
    }
}
</script>
<style scoped>
.note{
    height: .88rem;
    position: fixed;
    left:0;
    top:0;
    line-height: .88rem;
    padding: 0 1rem;
    background-color:rgb(255, 255, 213);
    color:rgb(36, 27, 13);
    text-align: center;
    overflow:hidden;
    text-overflow: ellipsis;
    width:100%;
    z-index: 10000;
}
</style>